package cn.hquanheng.java_base.day06Text;

public class Rectangle {
	private double height;
	private double width;

	public Rectangle() {
		height = 1.0;
		width = 1.0;
	}

	public Rectangle(double width, double height) {
		this.width = width;
		this.height = height;
	}

	public double getArea() {
		return height * width;
	}

	public double getPerimeter() {
		return 2 * (height + width);
	}

	public String toString() {
		return "width:" + width + ",height:" + height + ",area:" + getArea() + ",Perimeter" + getPerimeter();
	}

	public double getHeight() {
		return height;
	}

	/* @Override
	 public String toString() {
	 return "Rectangle [height=" + height + ", width=" + width + ", getArea()=" +
	 getArea() + ", getPerimeter()="
	 + getPerimeter() + "]";
	 }*/
	public void setHeight(double height) {
		this.height = height;
	}

	public double getWidth() {
		return width;
	}

	public void setWidth(double width) {
		this.width = width;
	}
}
